package com.rt.cloud.auth.facade;

import com.rt.easyjava.base.biz1.service.intf.TmptAuthUserBizService;
import com.rt.easyjava.common.base.Result;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import javax.annotation.Resource;

@Service
public class UserApi {

    @Resource
    TmptAuthUserBizService tmptAuthUserBizService;

    /**
     * 验证密码，登录失败次数，最后登录时间记录等等
     * @param loginname
     * @param passwordInput
     * @param passwordUser
     * @return
     */
    //@PostMapping(value="/core/coding/tmptAuthUser/validatePassword")
    public Result validatePassword(@PathVariable("loginname") String loginname, @PathVariable("passwordInput") String passwordInput, @PathVariable("passwordUser") String passwordUser, @PathVariable("loginTimes") String loginTimes){
        try {
            System.out.println("------->");
            tmptAuthUserBizService.validatePassword(loginname, passwordInput, passwordUser, loginTimes);
        }catch (Exception e) {
            System.out.println(e.getLocalizedMessage());
            return Result.builder().fault(e.getLocalizedMessage());
        }
        return Result.builder();
    }


}
